<template>
  <header class="t-header">
    <div class="header-container">
      <!-- Logo区域 -->
      <div class="logo-section">
        <router-link to="/" class="logo">
          <img src="@/assets/logo.svg" alt="TUI Logo" class="logo-img" />
        </router-link>
      </div>

      <!-- 频道导航区域 -->
      <nav class="channel-nav">
        <ul class="nav-list">
          <li class="nav-item">
            <router-link to="/" class="nav-link">首页</router-link>
          </li>
          <li class="nav-item">
            <router-link to="/data" class="nav-link">数据</router-link>
          </li>
          <li class="nav-item">
            <router-link to="/analysis" class="nav-link">分析</router-link>
          </li>
          <li class="nav-item">
            <router-link to="/settings" class="nav-link">设置</router-link>
          </li>
        </ul>
      </nav>

      <!-- 用户信息区域 -->
      <div class="user-section">
        <button class="user-btn">
          <span class="user-avatar">U</span>
          <span class="user-name">用户</span>
        </button>
      </div>
    </div>
  </header>
</template>

<style scoped>
.t-header {
  background-color: var(--bg-secondary);
  border-bottom: var(--border);
  /* 添加底部光影效果 */
  box-shadow: 0 2px 10px rgba(0, 240, 255, 0.3);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
}

.logo-section {
  display: flex;
  align-items: center;
}

/* 修改Logo样式 */
.logo-img {
  width: 40px; /* 根据实际Logo大小调整 */
  height: auto;
  margin-right: 2rem;
  filter: drop-shadow(var(--glow)); /* 添加科技感发光效果 */
}

.channel-nav {
  flex: 1;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin-right: 1.5rem;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.user-section {
  display: flex;
  align-items: center;
}

.user-btn {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-dark);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 0.5rem;
}

.user-name {
  font-size: 0.9rem;
}

/* 添加路由链接激活样式 */
.nav-link.router-link-exact-active {
  color: var(--accent);
}

.nav-link.router-link-exact-active::after {
  width: 100%;
}
</style>
